package com.ff.neuropp.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ff.neuropp.Dto.PageDto;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.neuropp.util.DateSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@Entity
@Table(name = "t_work", uniqueConstraints = {@UniqueConstraint(columnNames="id")})
/**
 * 作业信息表
 * @author sun_weiwu
 *
 */
public class Work extends PageDto {
	 private static final long serialVersionUID = 1L;


	    @Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    private int id;
	    
	    @Column(name = "work_name", columnDefinition = "varchar(100) COMMENT '作业名称'")
	    @ApiModelProperty(value = "作业名称")
	    private String workName;

	    
	    @Column(name = "work_content", columnDefinition = "varchar(100) COMMENT '作业内容'")
	    @ApiModelProperty(value = "作业内容")
	    private String workContent;

	 
	    @Column(name = "work_start_time", columnDefinition = "datetime COMMENT '作业开始时间'")
	    @ApiModelProperty(value = "作业开始时间")
		@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
		@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    private Date workStartTime;
	    
	    @Column(name = "work_end_time", columnDefinition = "datetime COMMENT '作业结束时间'")
	    @ApiModelProperty(value = "作业结束时间")
		@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
		@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    private Date workEndTime;
	    
		@Column(name = "status")
		@ApiModelProperty(value = "状态 1、线上 0、下线")
		private Integer status=1;
	    
	    //操作时间
	    @Column(updatable = false)
	    @org.hibernate.annotations.CreationTimestamp
	    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
		@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    private Date createDate;
	    
	    @Column(name = "update_time", columnDefinition = "datetime COMMENT '更新时间'")
	    private Date updateTime;
	    
}
